package com.zyz.common.core.domain.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zyz.common.annotation.Encrypt;
import com.zyz.common.annotation.Excel;
import com.zyz.common.annotation.FileData;
import com.zyz.common.core.domain.BaseEntity;


import javax.validation.constraints.Pattern;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;

/**
 * 用户管理对象 user
 *
 * @author Administrator
 * @date 2021-02-23
 */
@FileData
@Encrypt
public class User extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 用户ID
     */
    private Long uid;

    /**
     * 平台类型：1安卓 2苹果 3电脑 4公众号 5小程序
     */
    private Integer platform;

    /**
     * 用户账号
     */
    @Excel(name = "用户账号")
    @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误")
    private String username;

    /**
     * 密码
     */
    @Encrypt
    private String password;

    /**
     * 用户昵称
     */
    @Excel(name = "用户昵称")
    private String nickname;

    /**
     * 真实姓名
     */
    @Excel(name = "真实姓名")
    private String realname;

    /**
     * 用户类型0注册用户 1临时用户
     */
    private Integer userType;

    /**
     * 用户邮箱
     */
    @Excel(name = "邮箱")
    private String email;

    /**
     * 用户性别（0男 1女 2未知）
     */
    private String sex;

    /**
     * 头像地址
     */
    @FileData
    private String avatar;

    /**
     * 余额
     */
    private BigDecimal balance;

    /**
     * 帐号审核状态（0待审核 1审核通过 2审核不通过）
     */
    private String checkStatus;

    /**
     * 删除标志（0默认 1删除）
     */
    private Integer delFlag;

    /**
     * 最后登录IP
     */
    private String loginIp;

    /**
     * 最后登录时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date loginDate;

    /**
     * 出生年月
     */
    private Date birthday;

    /**
     * 消息推送接收状态：0接收 1不接收
     */
    private Integer receivePushStatus;

    /**
     * 公司名
     */
    @Excel(name = "公司名")
    private String companyName;

    /**
     * 营业执照
     */
    @FileData
    private String businessLicense;

    /**
     * 公司地址
     */
    @Excel(name = "公司地址")
    private String companyAddress;

    /**
     * 上级uid
     */
    private Long superiorUid;

    /**
     * 会员等级：0普通会员 1一级会员 2二级会员 3内部员工
     */
    private Integer userLevel;

    /**
     * 服务精灵查看权限：0无 1有
     */
    private Integer serveFlag;
    /**
     * 积分
     */
    private Integer integral;

    /**
     * 客户是否注册过 只针对客户类型 0 未注册 1 注册
     */
    private Integer registerClient;
    /**
     * 添加上级用户方式 0 后台添加 1自己添加
     */
    private Integer superiorType;
    /**
     * 意向产品id(多个以英文逗号分隔 )
     */
    private String intentionalProduct;

    /**
     * 微信登录用户唯一标识
     */
    private String wxUnionid;

    /**
     * 用户印章路径
     */
    @FileData
    private String sealPath;

    /**
     * 所属公司id
     */
    private Long companyId;

    /**
     * 所属公司
     */
    private Map<String, Object> whereCompany;

    /**
     * 区域经理下面的订单总数
     */
    private Long orderCount;

    /**
     * 区域经理下面近30天订单
     */
    private Long newOrderCount;

    /**
     * 区域经理的抽成总数
     */
    private Double money;

    /**
     * 区域经理近一个月的抽成
     */
    private Double newMoney;

    /**
     * 区域经理管理的代理商统计
     */
    private Long userCount;

    /**
     * 区域经理本月新增的代理商
     */
    private Long newUserCount;

    /**
     * 代理的订单总交易额
     */
    private Double orderMoney;

    /**
     * 用户所属公司名
     */
    private String company;

    /**
     * 设置上级id时间
     */
    private Date superiorTime;

    /**
     * 代理商总订单数
     */
    private Long agentOrderCount;

    /**
     * 上级用户账号
     */
    private String superName;

    private String products;

    /**
     * 论坛审核权限 0无 1有
     */
    private Integer reviewPermissions;

    public String getProducts() {
        return products;
    }

    public void setProducts(String products) {
        this.products = products;
    }

    public Map<String, Object> getWhereCompany() {
        return whereCompany;
    }

    public void setWhereCompany(Map<String, Object> whereCompany) {
        this.whereCompany = whereCompany;
    }

    public String getSuperName() {
        return superName;
    }

    public void setSuperName(String superName) {
        this.superName = superName;
    }

    public Long getAgentOrderCount() {
        return agentOrderCount;
    }

    public void setAgentOrderCount(Long agentOrderCount) {
        this.agentOrderCount = agentOrderCount;
    }

    public Integer getSuperiorType() {
        return superiorType;
    }

    public void setSuperiorType(Integer superiorType) {
        this.superiorType = superiorType;
    }

    public String getIntentionalProduct() {
        return intentionalProduct;
    }

    public void setIntentionalProduct(String intentionalProduct) {
        this.intentionalProduct = intentionalProduct;
    }

    public Integer getIntegral() {
        return integral;
    }

    public void setIntegral(Integer integral) {
        this.integral = integral;
    }

    public String getWxUnionid() {
        return wxUnionid;
    }

    public void setWxUnionid(String wxUnionid) {
        this.wxUnionid = wxUnionid;
    }

    public String getSealPath() {
        return sealPath;
    }

    public void setSealPath(String sealPath) {
        this.sealPath = sealPath;
    }

    public Integer getServeFlag() {
        return serveFlag;
    }

    public void setServeFlag(Integer serveFlag) {
        this.serveFlag = serveFlag;
    }

    public Integer getRegisterClient() {
        return registerClient;
    }

    public void setRegisterClient(Integer registerClient) {
        this.registerClient = registerClient;
    }

    public Long getSuperiorUid() {
        return superiorUid;
    }

    public void setSuperiorUid(Long superiorUid) {
        this.superiorUid = superiorUid;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getBusinessLicense() {
        return businessLicense;
    }

    public void setBusinessLicense(String businessLicense) {
        this.businessLicense = businessLicense;
    }

    public String getCompanyAddress() {
        return companyAddress;
    }

    public void setCompanyAddress(String companyAddress) {
        this.companyAddress = companyAddress;
    }

    public void setUid(Long uid) {
        this.uid = uid;
    }

    public Long getUid() {
        return uid;
    }

    public void setPlatform(Integer platform) {
        this.platform = platform;
    }

    public Integer getPlatform() {
        return platform;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getUsername() {
        return username;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPassword() {
        return password;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getNickname() {
        return nickname;
    }

    public void setRealname(String realname) {
        this.realname = realname;
    }

    public String getRealname() {
        return realname;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getEmail() {
        return email;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getSex() {
        return sex;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    public BigDecimal getBalance() {
        return balance;
    }

    public void setCheckStatus(String checkStatus) {
        this.checkStatus = checkStatus;
    }

    public String getCheckStatus() {
        return checkStatus;
    }

    public void setDelFlag(Integer delFlag) {
        this.delFlag = delFlag;
    }

    public Integer getDelFlag() {
        return delFlag;
    }

    public void setLoginIp(String loginIp) {
        this.loginIp = loginIp;
    }

    public String getLoginIp() {
        return loginIp;
    }

    public void setLoginDate(Date loginDate) {
        this.loginDate = loginDate;
    }

    public Date getLoginDate() {
        return loginDate;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setReceivePushStatus(Integer receivePushStatus) {
        this.receivePushStatus = receivePushStatus;
    }

    public Integer getReceivePushStatus() {
        return receivePushStatus;
    }

    public Integer getUserLevel() {
        return userLevel;
    }

    public void setUserLevel(Integer userLevel) {
        this.userLevel = userLevel;
    }

    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    public Long getOrderCount() {
        return orderCount;
    }

    public void setOrderCount(Long orderCount) {
        this.orderCount = orderCount;
    }

    public Long getNewOrderCount() {
        return newOrderCount;
    }

    public void setNewOrderCount(Long newOrderCount) {
        this.newOrderCount = newOrderCount;
    }

    public Double getMoney() {
        return money;
    }

    public void setMoney(Double money) {
        this.money = money;
    }

    public Double getNewMoney() {
        return newMoney;
    }

    public void setNewMoney(Double newMoney) {
        this.newMoney = newMoney;
    }

    public Double getOrderMoney() {
        return orderMoney;
    }

    public void setOrderMoney(Double orderMoney) {
        this.orderMoney = orderMoney;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public Date getSuperiorTime() {
        return superiorTime;
    }

    public void setSuperiorTime(Date superiorTime) {
        this.superiorTime = superiorTime;
    }

    public Long getUserCount() {
        return userCount;
    }

    public void setUserCount(Long userCount) {
        this.userCount = userCount;
    }

    public Long getNewUserCount() {
        return newUserCount;
    }

    public void setNewUserCount(Long newUserCount) {
        this.newUserCount = newUserCount;
    }

    public Integer getReviewPermissions() {
        return reviewPermissions;
    }

    public void setReviewPermissions(Integer reviewPermissions) {
        this.reviewPermissions = reviewPermissions;
    }

    @Override
    public String toString() {
        return "User{" + "uid=" + uid + ", platform=" + platform + ", username='" + username + '\'' + ", password='"
                + password + '\'' + ", nickname='" + nickname + '\'' + ", realname='" + realname + '\'' + ", userType="
                + userType + ", email='" + email + '\'' + ", sex='" + sex + '\'' + ", avatar='" + avatar + '\''
                + ", balance=" + balance + ", checkStatus='" + checkStatus + '\'' + ", delFlag=" + delFlag
                + ", loginIp='" + loginIp + '\'' + ", loginDate=" + loginDate + ", birthday=" + birthday
                + ", receivePushStatus=" + receivePushStatus + ", companyName='" + companyName + '\''
                + ", businessLicense='" + businessLicense + '\'' + ", companyAddress='" + companyAddress + '\''
                + ", superiorUid=" + superiorUid + ", userLevel=" + userLevel + ", serveFlag=" + serveFlag
                + ", integral=" + integral + ", registerClient=" + registerClient + ", superiorType=" + superiorType
                + ", intentionalProduct='" + intentionalProduct + '\'' + ", wxUnionid='" + wxUnionid + '\''
                + ", sealPath='" + sealPath + '\'' + ", companyId=" + companyId + ", whereCompany=" + whereCompany
                + ", orderCount=" + orderCount + ", newOrderCount=" + newOrderCount + ", money=" + money + ", newMoney="
                + newMoney + ", userCount=" + userCount + ", newUserCount=" + newUserCount + ", orderMoney="
                + orderMoney + ", company='" + company + '\'' + ", superiorTime=" + superiorTime + ", agentOrderCount="
                + agentOrderCount + ", superName='" + superName + '\'' + '}';
    }
}